<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试</title>
    <script src="../Vue/vue.js"></script>
    <script src="../Vue/vue-router.js"></script>
</head>
<body>
<div id="app">
    <router-view></router-view>
</div>
<template id="tonux"></template>
<template id="bdd">
    <div>
        <div style="width: 100px;height: 100px;background-color:red;"></div>
    </div>
</template>
<script>
    var bdd = Vue.extend({
        template: "#bdd"
    });
    var router = new VueRouter({
        routes: [
            {path: "/", component: tonux},
            {path: "/bdd", component: bdd, name: "ubdd"}
        ]
    });
    var vue = new Vue({
        el: "#app",
        data: {},
        router,
        methods: {
            adds() {
                this.$router.push({name: "ubdd"});
            }
        }
    });
</script>
</body>
</html>